package com.wing.productionPlan.model.entity;

import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 审核记录表
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("audit_record")
public class AuditRecord extends BaseEntity<AuditRecord> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum CheckStatus implements IEnum<Integer> {

        /**
        * 审核通过
        */
        approve(0,"审核通过"),
        /**
        * 驳回
        */
        reject(1,"驳回");

        private int code;
        private String desc;

        CheckStatus(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    public enum Type implements IEnum<Integer> {

        /**
        * 生产计划
        */
        productionplan(0,"生产计划");

        private int code;
        private String desc;

        Type(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;
    /**
     * 描述
     */
    private String remark;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 业务id
     */
    private Long businessId;

    /**
     * 审核状态
     */
    private CheckStatus checkStatus;

    /**
    * 审核状态描述
    */
    @TableField(exist = false)
    private String checkStatusDesc;

    public String getCheckStatusDesc() {
        return checkStatus == null ? null : checkStatus.getDesc();
    }

    /**
     * 审核模块
     */
    private Type type;

    /**
    * 审核模块描述
    */
    @TableField(exist = false)
    private String typeDesc;

    public String getTypeDesc() {
        return type == null ? null : type.getDesc();
    }

}
